<!DOCTYPE html>
<html>
<head>
    <title>商铺产品信息管理</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <!--<i-input v-model="q.name" @on-enter="query" placeholder="商铺名称"/>-->
                    <i-select v-model="q.shopId" filterable  not-found-text>
                        <i-option v-for="shops in shopss" :value="shops.id" :key="shops.id">{{shops.shopName}}</i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("productrelateshop:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("productrelateshop:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("productrelateshop:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="productRelateShop" :rules="ruleValidate" :label-width="80">
            <Form-item  label="商品类型">
                <i-select v-model="productRelateShop.productTypeId" @on-change="getGoodss" filterable>
                    <i-option v-for="productType in productTypes" :value="productType.id" :key="productType.id">{{productType.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item  label="商品名称">
                <i-select v-model="productRelateShop.goodId" filterable not-found-text>
                    <i-option v-for="good in goodss" :value="good.id" :key="good.id" >{{good.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item  label="产品规格">
                <i-select v-model="productRelateShop.productId" filterable>
                    <i-option v-for="product in products" :value="product.id" :key="product.id">{{product.specificationValue}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="选择寝室楼"  prop="name">
                <i-input  :value="areaBuilding.name" :key="areaBuilding.id"  @on-click="areaTree" icon="eye" readonly="readonly"
                         placeholder="选择寝室楼"/>
            </Form-item>
            <Form-item  label="店铺名称">
                <i-select v-model="productRelateShop.shopId" filterable not-found-text>
                    <i-option v-for="shops in shopss" :value="shops.id" :key="shops.id">{{shops.shopName}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="库存数量" prop="stockNum">
                <i-input v-model="productRelateShop.stockNum" placeholder="库存数量"/>
            </Form-item>
            <Form-item label="状态" prop="status">
                <Radio-group v-model="productRelateShop.status">
                    <Radio  label="0">
                        <span>上架</span>
                    </Radio>
                    <Radio label="1">
                        <span>下架</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<!-- 选择区域 -->
<div id="areaLayer" style="display: none;padding:10px;">
    <ul id="areaTree" class="ztree"></ul>
</div>

<script src="${rc.contextPath}/js/shop/productrelateshop.js?_${date.systemTime}"></script>
</body>
</html>